<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo CHtml::encode(Yii::app()->params["app"]["name"]); ?>&rsaquo; <?php echo CHtml::encode($this->pageTitle); ?></title>
<link rel="shortcut icon" href="<?php echo(Yii::app()->request->baseUrl.Yii::app()->params['app']['logoSmall']);?>" />
<link rel='stylesheet'
	href='<?php echo Yii::app()->request->baseUrl; ?>/statics/css/load-styles.css?v=<?php echo(Yii::app()->params['app']['version'])?>'
	type='text/css' media='all' />
<link rel='stylesheet' id='zh-cn-pack-style-dashboard-css'
	href='<?php echo Yii::app()->request->baseUrl; ?>/statics/css/zh_CN-dashboard.css?v=<?php echo(Yii::app()->params['app']['version'])?>'
	type='text/css' media='all' />
<link rel='stylesheet' id='thickbox-css'
	href='<?php echo Yii::app()->request->baseUrl; ?>/statics/css/thickbox.css?v=<?php echo(Yii::app()->params['app']['version'])?>'
	type='text/css' media='all' />
<link rel='stylesheet' id='thickbox-css'
    href='<?php echo Yii::app()->request->baseUrl; ?>/statics/css/form.css?v=<?php echo(Yii::app()->params['app']['version'])?>'
    type='text/css' media='all' />
<link rel='stylesheet' id='thickbox-css'
    href='<?php echo Yii::app()->request->baseUrl; ?>/statics/css/miniyunbtn.css?v=<?php echo(Yii::app()->params['app']['version'])?>'
    type='text/css' media='all' />
<link rel='stylesheet' id='colors-css'
	href='<?php echo Yii::app()->request->baseUrl; ?>/statics/css/colors-fresh.css?v=<?php echo(Yii::app()->params['app']['version'])?>'
	type='text/css' media='all' />
<script type='text/javascript'
	src='<?php echo Yii::app()->request->baseUrl; ?>/statics/javascript/jquery/jquery.js?v=<?php echo(Yii::app()->params['app']['version'])?>'></script>
<script type='text/javascript'
	src='<?php echo Yii::app()->request->baseUrl; ?>/statics/javascript/l10n.js?v=<?php echo(Yii::app()->params['app']['version'])?>'></script>
<script type='text/javascript'
	src='<?php echo Yii::app()->request->baseUrl; ?>/statics/javascript/load-scripts.js?v=<?php echo(Yii::app()->params['app']['version'])?>'></script>
<script type='text/javascript'
	src='<?php echo Yii::app()->request->baseUrl; ?>/statics/javascript/load-scripts1.js?v=<?php echo(Yii::app()->params['app']['version'])?>'></script>

</head>
<body
	class="Miniyun-admin no-js  index-php branch-3-2 version-3-2-1 admin-color-fresh">
<script type="text/javascript">
//<![CDATA[
(function(){
var c = document.body.className;
c = c.replace(/no-js/, 'js');
document.body.className = c;
})();
//]]>
</script>

<div id="Miniyunwrap">

<div id="menuback"></div>
<div id="menuwrap">
<div id="menushadow"></div>
<ul id="menu">

<?php
$siteMap = Yii::app()->params['adminSiteMap'];
foreach($siteMap as $module=>$subPlugins): ?>
<?php

$selectedModule = false;
$keys = array_keys($subPlugins);
$values = array_values($subPlugins);

$currentRoute = $this->route;
if ($this->route == "adminSettingPanel/url"){
     $currentRoute = "adminSettingPanel/user";
}

if(in_array($currentRoute,$values)){
	$selectedModule = true;
}
$temp = explode("/",$values[0]);
$icon = $temp[0];

if ($keys[0] == 'API 文档') $icon = 'adminApi';

$fistPluginUrl = $subPlugins[$keys[0]];?>
	<li
		class="Miniyun-first-item Miniyun-has-submenu <?php if($selectedModule):?> Miniyun-has-current-submenu <?php endif; ?> Miniyun-menu-open menu-top menu-top-first menu-icon-<?php echo($icon); ?> menu-top-last"
		id="menu-dashboard">
	<div class='Miniyun-menu-image'><a
		href='<?php if ($keys[0] == 'API 文档'){echo $fistPluginUrl;}echo(Yii::app()->createUrl($fistPluginUrl)); ?>'><br />
	</a></div>
	<div class="Miniyun-menu-arrow">
	<div></div>
	</div>
	<div class="Miniyun-menu-toggle"><br/>
	</div>
	<a
		href='<?php if ($keys[0] == 'API 文档'){echo $fistPluginUrl;}echo(Yii::app()->createUrl($fistPluginUrl)); ?>'
		class="Miniyun-first-item Miniyun-has-submenu <?php if($selectedModule):?> Miniyun-has-current-submenu <?php endif; ?>  menu-top menu-top-first menu-icon-<?php echo($icon); ?> menu-top-last"><?php echo($module); ?></a>
	<div class='Miniyun-submenu'>
	<div class='Miniyun-submenu-wrap'>
	<div class='Miniyun-submenu-head'><?php echo($module); ?></div>
	<ul>

	<?php foreach($subPlugins as $pluginName=>$pluginUrl): ?>

		<li <?php if(strstr($pluginUrl,$currentRoute)): ?> class="current"
		    <?php endif; ?>><a href='<?php if ($pluginName == 'API 文档'){echo $pluginUrl;}else {echo(Yii::app()->createUrl($pluginUrl));} ?>'
			><?php echo($pluginName); ?></a></li>
			<?php endforeach; ?>
	</ul>
	</div>
	</div>
	</li>
	<?php endforeach; ?>
	<li id="collapse-menu" class="hide-if-no-js">
	<div id="collapse-button">
	<div></div>
	</div>
	<span>收起菜单</span></li>
</ul>
</div>
<div id="Miniyuncontent">
<div id="Miniyunhead">
<h1 id="site-heading"><a href="<?php echo(Yii::app()->params['app']['host']);?>" title="查看站点"><img src="<?php echo(Yii::app()->request->baseUrl.Yii::app()->params['app']['logo']);?>" height="32px" /> </a></h1>
<div id="Miniyunhead-info">

<div id="user_info">
<p class="hide-if-js">您好，<?php
 $user  = Yii::app()->session["user"];
 $nick  = $user["nick"];
 if(!isset($nick) || strlen($nick)==0){
 	$nick = $user["name"];
 }
 echo($nick);
 ?> | <a
	href="<?php echo(Yii::app()->createUrl("adminUserPanel/update"));?>"
	title="编辑您的个人资料">我的个人资料</a> | <a
	href="<?php echo(Yii::app()->createUrl("ite/logout")); ?>"
	title="登出">登出</a></p>

<div class="hide-if-no-js">
<p>您好，<?php echo($nick); ?></p>
<div id="user_info_arrow"></div>
<div id="user_info_links_wrap">
<div id="user_info_links">

<ul>
	<li><a
		href="<?php echo(Yii::app()->createUrl("adminUserPanel/update"));?>"
		title="编辑您的个人资料">我的个人资料</a></li>
	<li><a href="<?php echo(Yii::app()->createUrl("site/logout"));?>"
		title="登出">登出</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>

</div>

<div id="Miniyunbody">

<div id="Miniyunbody-content">
<div id="screen-meta">
<div class="wrap">

<?php echo $content; ?>

<div class="clear"></div>
</div>
<!-- Miniyunwrap -->

<div class="clear"></div>
</div>
<!-- Miniyunbody-content -->
<div class="clear"></div>
</div>
<!-- Miniyunbody -->
<div class="clear"></div>
</div>
<!-- Miniyuncontent --> <script type="text/javascript">if(typeof MiniyunOnload=='function')MiniyunOnload();</script>

</body>

</html>
